Conversation
|
FYI I'm working on a basisu asset processor in beicause/bevy_basisu_loader#33 |
| return Err(CompressedImageSaverError::UninitializedImage); | ||
| }; | ||
|
|
||
| if image.texture_descriptor.mip_level_count != 1 { |
There was a problem hiding this comment.
Note ctt can deal with any source amount of mips
| stride: image.width() * bytes_per_pixel, | ||
| format: input_format, | ||
| color_space, | ||
| alpha: ctt::AlphaMode::Straight, // TODO: User-configurable? |
There was a problem hiding this comment.
Yeah this should be user configurable.
| container: ctt::Container::Ktx2, | ||
| quality: ctt::Quality::default(), | ||
| output_color_space: None, | ||
| output_alpha: None, |
There was a problem hiding this comment.
The correct default here is Some(premultiplied), though should be user configurable
andriyDev
left a comment
There was a problem hiding this comment.
Overall LGTM. We're just calling another lib!
I haven't tested this locally, but the code looks fine (barring one complaint).
| }) | ||
| } | ||
|
|
||
| #[cfg(feature = "compressed_image_saver_universal")] |
There was a problem hiding this comment.
I am really not a fan of this. Saying we just straight up can't compile either case if both features are enabled kinda sucks.
WDYT about just having two CompressedImageSavers? CompressedImageSaverCtt and CompressedImageSaverUniversal? Then just pick one in the plugin? This way if users want to use the old compression, they can. You could also have a wrapper CompressedImageSaver for compatibility (which internally holds one of the backends), so that we keep old meta files working.
I am personally not a fan of mutually exclusive feature flags, since it means I can't just test with --all-features.
There was a problem hiding this comment.
Generally the idea was that you'd always be using CompressedImageSaver (same meta files), and then depending on what platform you want to target, you'd enable different backends.
There was a problem hiding this comment.
I think you can use feature gate within a custom asset processor instead of asset savers, instead of using LoadTransformAndSave.
| /// | ||
| /// # ASTC override | ||
| /// | ||
| /// Set the `BEVY_COMPRESSED_IMAGE_SAVER_ASTC` environment variable to compress into ASTC |
There was a problem hiding this comment.
I think the default should be based on the target. Like android and ios should default to ASTC and other platforms default to BCn.
There was a problem hiding this comment.
I was thinking about this, but it would be pretty standard to compile for one platform on another, e.g. in CI, right?
There was a problem hiding this comment.
Where does this code run? If you're cross compiling you should know the target you're cross compiling to.
| /// increases GPU cache hits, improving rendering performance. Input images must have a | ||
| /// `mip_level_count` of 1 (i.e., no pre-existing mip chain); the compressor will produce |
There was a problem hiding this comment.
I think this isn't true unless you force it? ctt will handle this
There was a problem hiding this comment.
I need to generate the Surfaces in the correct order from Bevy's data, which I didn't feel like figuring out...
Objective
Closes #14671.
Solution
Testing
Showcase
While a showcase should aim to be brief and digestible, you can use a toggleable section to save space on longer showcases:
Click to view showcase